//
//  vdAtlasShapeContainer.h
//  Void Dead
//
//  Created by Sidney Just on 20.12.09.
//
//  Copyright © 2009 by Sidney Just
//  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
//  documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
//  the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 
//  and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
//  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
//  PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
//  FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
//  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

#import <Foundation/Foundation.h>

#import "vdShapeContainer.h"
#import "vdTexNode.h"

/**
 * This class is like the vdShapeContainer class, but it allows you to use atlas shapes instead of fixed shapes!
 **/
@interface vdAtlasShapeContainer : vdShapeContainer {

}

/**
 * Adds a new shape to the container. This will automatically be over all older shapes!!!
 @param point The position of the shape, relative to the container position
 @param rect The atlas tile that the shape should display (this must be inside of the texture!)
 @return Pointer to the new shape
 **/
- (vdInlineShape *)addShape:(CGPoint)point withAtlas:(CGRect)rect;

/**
 * Adds a new shape to the container. This will automatically be over all older shapes!!!
 @param point The position of the shape, relative to the container position
 @param rect The atlas tile that the shape should display (this must be inside of the texture!)
 @param key The shape will get the given key which can be used to get the pointer to this shape
 @return Pointer to the new shape
 **/
- (vdInlineShape *)addShape:(CGPoint)point withAtlas:(CGRect)rect forKey:(int)key;

/**
 * Adds a new shape to the container. This will automatically be over all older shapes!!!
 @param point The position of the shape, relative to the container position
 @return Pointer to the new shape
 **/
- (vdInlineShape *)addShape:(CGPoint)point;

/**
 * Sets the texture of the shape
 @param tex The new texture of the shapes or NULL
 **/
- (void)setTexture:(vdTexNode *)tex;


/**
 * Updates the Atlasrect for the given shape
 @param rect The new Atlasrect
 @param _shape The shape which should get the new rect
 **/
- (void)updateAtlas:(CGRect)rect forShape:(vdInlineShape *)_shape;

@end
